<?php
/**
 * Created by PhpStrom
 * User: 郭碧云
 * Date: 2021/7/9 9:07
 * Desc:
 */

namespace App\Http\Controllers;

use Illuminate\Http\Request;

class UploadController extends BaseAdminController
{
    /**
     * 上传图片
     */
    public function upload(Request $request) {
        /*$file = $request->file('img');
        return uploadImg($file,$request->post("path"));*/
        $file = $request->file('img')?$request->file('img'):$request->file('upload');
        $type = $request->all(["type"])["type"]>0?$request->all(["type"])["type"]:0;
        return uploadImg($file,$request->all(["path"])["path"],'local',$type);
    }
}
